package dniegp2pclient;

import org.jdesktop.application.Application;
import org.jdesktop.application.SingleFrameApplication;

public class DNIeGP2PClientApp extends SingleFrameApplication {

    DNIeGP2PClientView clientView;
    //ApplicationContext appCtxt =
    //        new ClassPathXmlApplicationContext("applicationContext.xml");

    /**
     * At startup create and show the main frame of the application.
     */
    @Override protected void startup() {
        RuntimeData.getInstance();
        clientView = new DNIeGP2PClientView(this);
        show(clientView);
        //Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        //clientView.getFrame().setSize(screenSize.width, screenSize.height);
    }

    /**
     * This method is to initialize the specified window by injecting resources.
     * Windows shown in our application come fully initialized from the GUI
     * builder, so this additional configuration is not needed.
     */
    @Override protected void configureWindow(java.awt.Window root) {
    }

    /**
     * A convenient static getter for the application instance.
     * @return the instance of DNIeGP2PClientApp
     */
    public static DNIeGP2PClientApp getApplication() {
        return Application.getInstance(DNIeGP2PClientApp.class);
    }

    /*
    public ApplicationContext getSpringContext() {
        return appCtxt;
    }*/

    /**
     * Main method launching the application.
     */
    public static void main(String[] args) {
        launch(DNIeGP2PClientApp.class, args);
    }

    public DNIeGP2PClientView getView() {
        return clientView;
    }
}
